This repository has been archived by the owner on Feb 21, 2024. It is now read-only.
Add MetaMask/Infura workaround for pending transactions #265
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds a workaround for an Infura issue (that becomes a problem with our MetaMask implementation) as documented here and more specifically here.
The crux of our issue is that
purser-metamask
'ssignTransaction
method attempts to get the transaction that MetaMask sent in the callback ofsendTransaction
, when it is pending. With most providers, thegetTransaction
method will respond with the transaction when it is pending, but Infura recently started returning an empty response.The workaround involves attempting to get the transaction immediately, and if that fails, using a
web3
0.20.x-compatible package (await-transaction-mined
) to wait for the transaction to be confirmed before getting the transaction.This PR also makes some improvements to various defaults as suggested in #261 .
Update chain defaults
HARDFORKS
defaults constantNETWORK_NAMES
defaults constantgetChainDefinition
NETWORK_IDS
defaults constant toCHAIN_IDS
getChainDefinition
Add MetaMask/Infura workaround
await-transaction-mined
dependency